---
- name: Create host entry
  delegate_to: "{{ ipa_server }}"
  ipahost:
    ipaadmin_password: "{{ ipa_admin_password }}"
    name: "{{ host }}"
    force: yes
  tags:
  - config
  - krb5

- name: Create service entry
  delegate_to: "{{ ipa_server }}"
  ipaservice:
    ipaadmin_password: "{{ ipa_admin_password }}"
    name: "{{ service }}/{{ host }}"
    principal: "{{ principal_alias | default(omit) }}"
    force: yes
  tags:
  - config
  - krb5
